{include file="public/_meta" /}
<body>
<div class="wrapper">

    {include file="public/_header" /}

    <!-- Sidebar -->
    {include file="public/_menu" /}
    <!-- End Sidebar -->

    <div class="main-panel">

        <div class="content">
            <div class="page-inner">

                <!-- 面包屑 -->
                {include file="public/_page_header" /}

                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card">
                                <div class="card-header">
                                    <h4 class="card-title">腾讯广告</h4>
                                </div>
                                <div class="card-body">
                                    <ul class="nav nav-pills nav-secondary nav-pills-no-bd" id="pills-tab-without-border" role="tablist">
                                        <li class="nav-item submenu">
                                            <a class="nav-link {if condition='$report_type == 1'}active{/if}" href="{:url('index',['report_type'=>1])}" role="tab" aria-controls="pills-home-nobd" aria-selected="true">运营人员</a>
                                        </li>
                                        <li class="nav-item submenu">
                                            <a class="nav-link {if condition='$report_type == 2'}active{/if}" href="{:url('index',['report_type'=>2])}" role="tab" aria-controls="pills-profile-nobd" aria-selected="false">广告账户</a>
                                        </li>
                                        <li class="nav-item submenu">
                                            <a class="nav-link {if condition='$report_type == 3'}active{/if}" href="{:url('index',['report_type'=>3])}" role="tab" aria-controls="pills-contact-nobd" aria-selected="false">广告计划</a>
                                        </li>
                                        <li class="nav-item submenu">
                                            <a class="nav-link {if condition='$report_type == 4'}active{/if}" href="{:url('index',['report_type'=>4])}" role="tab" aria-controls="pills-contact-nobd" aria-selected="false">广告组</a>
                                        </li>
                                        <li class="nav-item submenu">
                                            <a class="nav-link {if condition='$report_type == 5'}active{/if}" href="{:url('index',['report_type'=>5])}" role="tab" aria-controls="pills-contact-nobd" aria-selected="false">广告创意</a>
                                        </li>
                                    </ul>

                                </div>


                                <div class="card-header">

                                    <form class="row">

                                        <div class="col-md-6 col-lg-2">
                                            <div class="form-group">
                                                <select class="form-control" name="admin_id">
                                                    <option value="0">全部运营</option>
                                                    {volist name="admins" id="vo"}
                                                    <option value="{$vo.id}" {if condition="$vo.id eq $admin_id"}selected{/if}>{$vo.realname}</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                        </div>

                                        {if condition="$report_type > 1"}
                                        <div class="col-md-6 col-lg-2">
                                            <div class="form-group">
                                                <select class="form-control" name="acc_name">
                                                    <option value="">全部账户</option>
                                                    {volist name="accounts" id="vo"}
                                                    <option value="{$vo.adv_id}" {if condition="$vo.adv_id eq $adv_id"}selected{/if}>{$vo.acc_name}</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                        </div>
                                        {/if}

                                        {if condition="$report_type > 2"}
                                        <div class="col-md-6 col-lg-2">
                                            <div class="form-group">
                                                <input type="text" class="form-control" name="campaign_name" id="campaign_name" value="{$campaign_name}" placeholder="请输入广告计划名称">
                                            </div>
                                        </div>
                                        {/if}

                                        {if condition="$report_type > 3"}
                                        <div class="col-md-6 col-lg-2">
                                            <div class="form-group">
                                                <input type="text" class="form-control" name="adgroup_name" id="adgroup_name" value="{$adgroup_name}" placeholder="请输入广告组名称">
                                            </div>
                                        </div>
                                        {/if}

                                        {if condition="$report_type > 4"}
                                        <div class="col-md-6 col-lg-2">
                                            <div class="form-group">
                                                <input type="text" class="form-control" name="ad_id" id="ad_id" value="{$ad_id}" placeholder="请输入创意ID">
                                            </div>
                                        </div>
                                        {/if}


                                        <div class="col-md-6 col-lg-2">
                                            <div class="form-group">
                                                <input type="text" class="form-control" name="times" id="times" value="{$times}" placeholder="选择日期" autocomplete="off">
                                            </div>
                                        </div>

                                        <div class="col-md-6 col-lg-2">
                                            <div class="form-group">
                                                <button type="submit" class="btn btn-primary">查询</button>
                                                <a href="/manage/tengxun/index/report_type/{$report_type}" class="btn btn-info" style="color: white;position: absolute;left: 110px;">重置</a>
                                            </div>
                                        </div>
                                    </form>

                                </div>

                            </div>





                            <div class="card-body">

                                <div class="table-responsive">
                                    <table id="add-row" class="display table table-striped table-hover" >
                                        <thead>
                                        <tr>
                                            {if condition='$report_type == 1'}
                                            <th>运营</th>
                                            {elseif condition='$report_type == 2' /}
                                            <th>账户</th>
                                            <th>所属运营</th>
                                            {elseif condition='$report_type == 3' /}
                                            <th>计划名称</th>
                                            <th>所属账户</th>
                                            <th>所属运营</th>
                                            {elseif condition='$report_type == 4' /}
                                            <th>所属广告组</th>
                                            <th>计划名称</th>
                                            <th>所属账户</th>
                                            <th>所属运营</th>
                                            {elseif condition='$report_type == 5' /}
                                            <th>创意名称【ID】</th>
                                            <th>所属广告组</th>
                                            <th>所属计划</th>
                                            <th>所属账户</th>
                                            <th>所属运营</th>
                                            {/if}
                                            <th>消费</th>
                                            <th>展现</th>
                                            <th>千次展现消费</th>
                                            <th>点击</th>
                                            <th>点击率</th>
                                            <th>平均点击价格</th>
                                            <th>转化</th>
                                            <th>转化成本</th>
                                            <th>转化率</th>
                                        </tr>
                                        </thead>

                                        <tbody>

                                        {volist name="infos" id="vo"}
                                        <tr>

                                            {if condition='$report_type == 1'}
                                            <td><a href="/manage/tengxun/index/report_type/{$report_type+1}/admin_id/{$vo.admin_id}">{$vo.admin_name}</a></td>
                                            {elseif condition='$report_type == 2' /}
                                            <td><a href="/manage/tengxun/index/report_type/{$report_type+1}/adv_id/{$vo.adv_id}">{$vo.acc_name}【{$vo.adv_id}】</a></td>
                                            <td>{$vo.admin_name}</td>
                                            {elseif condition='$report_type == 3' /}
                                            <td><a href="/manage/tengxun/index/report_type/{$report_type+1}/campaign_name/{$vo.campaign_name}">{$vo.campaign_name}</a></td>
                                            <td>{$vo.acc_name}【{$vo.adv_id}】</td>
                                            <td>{$vo.admin_name}</td>
                                            {elseif condition='$report_type == 4' /}
                                            <td><a href="/manage/tengxun/index/report_type/{$report_type+1}/adgroup_name/{$vo.adgroup_name}">{$vo.adgroup_name}</a></td>
                                            <td>{$vo.campaign_name}</td>
                                            <td>{$vo.acc_name}【{$vo.adv_id}】</td>
                                            <td>{$vo.admin_name}</td>
                                            {elseif condition='$report_type == 5' /}
                                            <td>{$vo.ad_name}【{$vo.ad_id}】</td>
                                            <td>{$vo.adgroup_name}</td>
                                            <td>{$vo.campaign_name}</td>
                                            <td>{$vo.acc_name}【{$vo.adv_id}】</td>
                                            <td>{$vo.admin_name}</td>
                                            {/if}
                                            <td>{$vo.cost_t/100 | format_number}</td>
                                            <td>{$vo.impression_t}</td>
                                            <td>{$vo.cost_impression/100 | format_number}</td>
                                            <td>{$vo.click_t}</td>
                                            <td>{$vo.click_impression | format_number_p}</td>
                                            <td>{$vo.cost_click/100 | format_number}</td>
                                            <td>{$vo.convert_t}</td>
                                            <td>{$vo.convert_cost/100 | format_number }</td>
                                            <td>{$vo.convert_click | format_number_p}</td>
                                        </tr>
                                        {/volist}

                                        </tbody>
                                    </table>

                                    <!-- 分页 (调取通用方法)-->
                                     <div class="layui-box layui-laypage layui-laypage-molv">{:pagination($infos)}</div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
        </div>

        {include file="public/_footer" /}


    </div>



</div>

{include file="public/_js" /}

</body>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">

    laydate.render({
        elem: '#times'
        ,type: 'date'
        ,range: true
    });

    $(function(){
        $("td").text(function(i,v){
            // return v.replace(/(?!^)(?=(\d{3})+($|\.))/g,",");
        });
    });

</script>
</html>




























